<template>
  <div>
    父组件
    <Child :value="msg" @changed="changed">
      <template v-slot:lilei> 李磊 </template>
      <template v-slot:lihuan="{ url }"> 李欢{{ url }} </template>
    </Child>
    <input type="text" v-model="cityName" />
  </div>
</template>
<script>
import Child from "./Child.vue";
export default {
  watch: {
    cityName: {
      handler(newName, oldName) {
        console.log(newName, oldName);
      },
      deep: true,
    },
  },
  data() {
    return {
      msg: "123",
      cityName: {
        id: "",
        name: "",
      },
    };
  },
  components: {
    Child,
  },
  methods: {
    changed(index) {
      console.log(index);
    },
  },
};
</script>
<style scoped>
</style>